package day8;

import java.util.ArrayList;

/**
 * @author oldliu
 * @since 1.0
 */
public class LordOwner {
    public static void main(String[] args) {

        Worker []w={new Worker("杨白劳"),new Worker("杨喜儿")};
        w[0].start();
        w[1].start();
        Thread.currentThread().setName("地主");
        while (true){
            try {
                System.out.println("地主睡觉了");
                Thread.sleep(1500);
                System.out.println("地主醒了，喊人干活");
                w[0].interrupt();
                w[1].interrupt();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
